from django.db import models

# Create your models here.

class TblOssNode(models.Model):

    cluster_name = models.CharField(max_length=64)
    plane_name = models.CharField(max_length=64)
    project_id = models.IntegerField()
    node_id = models.IntegerField(primary_key=True)
    node_name = models.CharField(max_length=64)
    node_type = models.IntegerField()
    node_ip = models.CharField(max_length=64)
    role = models.IntegerField()
    slave_num = models.IntegerField()
    master_nid = models.IntegerField()
    stream_mid = models.IntegerField()
    template_name = models.CharField(max_length=64)
    op_status = models.IntegerField()
    server_id = models.IntegerField()
    disk_id = models.IntegerField()
    cpu_cores = models.IntegerField()
    cpu_upper_cores = models.IntegerField()
    dram_cap = models.IntegerField()
    ssd_cap = models.IntegerField()
    hdd_cap = models.IntegerField()
    pooler_port = models.IntegerField()
    pg_port = models.IntegerField()
    fn_port = models.IntegerField()
    sync_type = models.IntegerField()
    ngroup_srmode = models.IntegerField()
    cgroup_level = models.IntegerField()
    node_flag = models.TextField()
    dbname = models.CharField(max_length=64)
    dbuser = models.CharField(max_length=64)
    dbpwd = models.CharField(max_length=128)
    tt_create = models.DateTimeField()
    tt_update = models.DateTimeField()
    bin_dir = models.CharField(max_length=256)
    data_dir = models.CharField(max_length=256)
    log_dir = models.CharField(max_length=256)
    package_name = models.CharField(max_length=64)
    alias_appname = models.CharField(max_length=32)
    slave_dns_weights = models.CharField(max_length=50)
    is_isolate_slave = models.BooleanField()
    isolation_type = models.IntegerField()
    recovery_lsn = models.IntegerField()

    #def __str__(self):
    #    return
    class Meta:
        managed = False
        #db_table = 'pgxzm_oss.tbl_oss_node'
        db_table = 'tbl_oss_node'
        app_label = 'tbase'
